import { getFldm } from '@/utils/get-fldm'
export const formItems = async (key: string) => {
  const obj: any = {
    ssflcx: [
      {
        disabled: false,
        label: '',
        prop: 'gjz',
        type: 'input',
        placeholder: '输入关键字',
        iswm: 'Y',
        width: '30%',
      },
      {
        disabled: false,
        label: '案件名称',
        prop: 'ajmc',
        type: 'input',
        placeholder: '输入案件名称',
        iswm: 'N',
      },
      {
        disabled: false,
        label: '档号',
        prop: 'dh',
        type: 'input',
        placeholder: '输入档号',
        iswm: 'N',
      },
      {
        disabled: false,
        label: '立卷单位',
        prop: 'ljdw',
        type: 'treeSelectAll',
        multiple: true,
        nodeKey: 'dwbm',
        showAll: true,
        isLeafNode: false,
        checkStrictly: false,
        props: {
          children: 'children',
          label: 'dwmc',
        },
        placeholder: '选择立卷单位',
        options: [],
        iswm: 'N',
      },
      {
        disabled: false,
        label: '归档年度',
        prop: 'gdnd',
        type: 'input',
        placeholder: '输入归档年度',
        iswm: 'N',
      },
      {
        disabled: false,
        label: '保管期限',
        prop: 'bgqx',
        type: 'select',
        placeholder: '选择保管期限',
        options: await getFldm('gd020'),
        iswm: 'N',
      },
      {
        disabled: false,
        label: '密级',
        prop: 'mj',
        type: 'select',
        placeholder: '选择密级',
        options: await getFldm('gd006'),
        iswm: 'N',
      },
      {
        disabled: false,
        label: '部门受案号',
        prop: 'bmsah',
        type: 'input',
        placeholder: '输入部门受案号',
        iswm: 'N',
      },
      {
        disabled: false,
        label: '检察官',
        prop: 'jcg',
        type: 'input',
        placeholder: '输入检察官',
        iswm: 'N',
      },
      {
        disabled: false,
        label: '当事人',
        prop: 'dsr',
        type: 'input',
        placeholder: '输入当事人',
        iswm: 'N',
      },
      {
        disabled: false,
        label: '案由',
        prop: 'ay',
        type: 'select',
        multiple: true,
        placeholder: '选择案由',
        iswm: 'N',
        options: await getFldm('9903'),
      },
    ],
    spflcx: [
      {
        disabled: false,
        label: '',
        prop: 'gjz',
        type: 'input',
        placeholder: '输入关键字',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '档号',
        prop: 'dh',
        type: 'input',
        placeholder: '输入档号',
        iswm: 'N',
        options: [],
      },
      {
        disabled: false,
        label: '立卷单位',
        prop: 'ljdw',
        type: 'treeSelect',
        multiple: true,
        nodeKey: 'dwbm',
        isLeafNode: false,
        props: {
          children: 'children',
          label: 'dwmc',
        },
        placeholder: '选择立卷单位',
        options: [],
        iswm: 'N',
      },
      {
        disabled: false,
        label: '保管期限',
        prop: 'bgqx',
        type: 'select',
        placeholder: '选择保管期限',
        options: await getFldm('gd020'),
        iswm: 'N',
      },
      {
        disabled: false,
        label: '归档年度',
        prop: 'gdnd',
        type: 'input',
        placeholder: '输入归档年度',
        iswm: 'N',
      },
      {
        disabled: false,
        label: '密级',
        prop: 'mj',
        type: 'select',
        placeholder: '选择密级',
        options: await getFldm('gd006'),
        iswm: 'N',
      },
      {
        disabled: false,
        label: '录制者',
        prop: 'lzz',
        type: 'input',
        placeholder: '输入录制者',
        iswm: 'N',
      },
      {
        disabled: false,
        label: '题名',
        prop: 'tm',
        type: 'input',
        placeholder: '输入题名',
        iswm: 'N',
      },
      {
        disabled: false,
        label: '视频类型',
        prop: 'splx',
        type: 'select',
        placeholder: '选择视频类型',
        iswm: 'N',
        options: await getFldm('gd021'),
      },
    ],
  }

  return obj[key]
}
